﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.DependencyInjection;
using Himp.Erp;

namespace Himp.Platform
{
    /// <summary>
    /// 
    /// </summary>
    public class DrugsQuery : ISingletonDependency
    {
        private readonly IServiceProvider _serviceProvider;

        public DrugsQuery(IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
        }

        /// <summary>
        /// 获取生产厂商列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<DrugPrdrDto>> GetDrugPrdrListAsync(DrugPrdrInput input)
        {
            var drugPrdrService = _serviceProvider.GetService<IDrugPrdrService>();

            return await drugPrdrService.GetListAsync(input);
        }

        /// <summary>
        /// 获取药品使用途径分组列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<DrugMedcWayGrpDto>> GetDrugMedcWayGrpListAsync(DrugMedcWayGrpInput input)
        {
            var drugMedcWayGrpService = _serviceProvider.GetService<IDrugMedcWayGrpService>();

            return await drugMedcWayGrpService.GetListAsync(input);
        }

        /// <summary>
        /// 药品目录类别列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<DrugCatalogTypeDto>> GetDrugCatalogTypeListAsync(DrugCatalogTypeInput input)
        {
            var drugCatalogTypeService = _serviceProvider.GetService<IDrugCatalogTypeService>();

            return await drugCatalogTypeService.GetListAsync(input);
        }

        /// <summary>
        /// 获取药品目录列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<DrugCatalogDto>> GetDrugCatalogListAsync(DrugCatalogInput input)
        {
            var drugCatalogService = _serviceProvider.GetService<IDrugCatalogService>();

            return await drugCatalogService.GetListAsync(input);
        }

        /// <summary>
        /// 获取药品目录列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<DrugCatalogExtDto>> GetDrugCatalogExtListAsync(DrugCatalogExtInput input)
        {
            var drugCatalogExtService = _serviceProvider.GetService<IDrugCatalogExtService>();

            return await drugCatalogExtService.GetListAsync(input);
        }
    }
}
